<?
define('BASEPATH', true);
include('inc/config.php');
if(!$is_online){
	redirect('index.php');
	exit;
}
  $sit = $db->FetchArray($db->Query("SELECT id,site,cpc FROM `surf` WHERE `confirm`='0' AND (`active` = '0' AND `points` >= `cpc`) AND (`id` NOT IN (SELECT `site` FROM `surfed` WHERE `user`='".$data['id']."') AND `user`!='".$data['id']."') ORDER BY `cpc` DESC LIMIT 1"));
  $nr = $db->GetNumRows($db->Query("SELECT id FROM `surf` WHERE `confirm`='0' AND (`active` = '0' AND `points` >= `cpc`) AND (`id` NOT IN (SELECT `site` FROM `surfed` WHERE `user`='".$data['id']."') AND `user`!='".$data['id']."')"));
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Auto-Surf</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" type="text/css" href="css/surf.css"/>    
	<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
	<script language="javascript" type="text/javascript" src="js/surf.js"></script>
	<? if($sit['id'] > 0){?><script type="text/javascript">$(document).ready(function() {init(<?=$site['surf_time']?>, <?=$site['surf_time']?>, <?=$site['surf_time']?>, <?=$sit['id']?>, <?=$data['id']?>);});</script><?}?>
  </head>
  <body>
<SCRIPT>
<!--
ID=window.setTimeout("popup();",10000);

function popup(){
   nytVindue=window.open('http://adf.ly/2847615/banner/www.likehits.dk','popup',
   'menubar=no,toolbar=no,status=no,width=300,height=300');
   }
// -->
<!--
ID=window.setTimeout("popup();",20000);

function popup(){
   nytVindue=window.open('http://adf.ly/2847615/banner/www.likehits.dk','popup',
   'menubar=no,toolbar=no,status=no,width=300,height=300');
   }
// -->
</SCRIPT>
   <div id="header-bar">
     <p class="meta-data"><? if($sit['id'] > 0){?>
	  <form name="f">
      <input type="button" name="m_text" class="timerBox" />
      <a href="#" onclick="pause();"><img name="b1" src="img/stop.png" border="0" alt="Pause" title="Pause"/></a>
      <a href="#" onclick="play();"><img name="b2" src="img/play.png" border="0" alt="Play" title="Play" /></a>
      </form><?}?>
     </p>
   </div>
   <div id="header-bar2">
     <p class="meta-data2">
        <? if($sit['id'] > 0){?>Remaining Sites: ~<?=($nr-1)?> | Your coins: <?=$data['coins']?> | You will receive <?=$sit['cpc']?> coins!<?}?>
     </p>
   </div>
   <iframe id="preview-frame" src="<?if($sit['id'] == ''){?>pages/nocoins.html<?}else{ echo $sit['site'];}?>" name="preview-frame" height="500" frameborder="0" noresize="noresize">
   </iframe>
</body>
</html>